<div class="search-box" {if mocod()=='index.main'} style="margin-left: 10px;margin-top: 10px; +margin-top: 18px;float:left" {/if} >
<select id="search-type" class="select_sel" onchange="front_search_select(this.value);"><option value="">商品</option><option value="seller" {if $_GET['mod']=='seller'}selected{/if}>商家</option></select>
<input type="text" id="search-txt"  value="{$kw}" {if $_GET['mod']=='seller'}placeholder="请输入商家名称等"{else}placeholder="请输入商品名称等"{/if}  class="input_h search-box__input"  onkeyup="if (event.keyCode == 13) front_search_request();" {if mocod()=='index.main'} style="width: 400px;" {/if}/>
<input class="search-box__button" type="button" value="搜索" onclick="front_search_request()" />
</div>
<script type="text/javascript">

var front_seller_base = "{echo logic('url')->create('seller', array('mod' => 'seller', 'kw' => 'xqw'))}";
var front_product_base = "{echo logic('url')->create('product', array('kw' => 'xqw'))}";
var front_search_base = "";
function front_search_request()
{
front_search_select($('#search-type').val());
window.location = front_search_base.replace('xqw', encodeURIComponent($('#search-txt').val()));
}
function front_search_select(val)
{
front_search_base = front_product_base;
$('#search-txt').attr('placeholder','请输入商品名称等');
if(val=='seller'){
front_search_base = front_seller_base;
$('#search-txt').attr('placeholder','请输入商家名称等');
}
}
</script>
<div style="display: none;">搜索框</div>